<include file="Public/head" title='登录'/>  
<body>
<div class="contain bg">
	<span class="middleSpan"></span>
	<div class="middleDiv">
		<div class="formList flexBox">
			<i class="iconfont icon-ren"></i>
			<input class="flexChild" id="name" type="text" placeholder="请输入用户名" />
		</div>
		<div class="formList flexBox">
			<i class="iconfont icon-lock"></i>
			<input class="flexChild" type="password" id="pass" placeholder="请输入密码" />
		</div>
		<button class="formList" onclick="save($('#name').val(),$('#pass').val())">登录</button>
	</div>
</div>
<script type="text/javascript">
	function save(name,pass){
		if(name==''){
			layer.msg("请输入用户名",{time:1500});
			return false;
		};
		if(pass==''){
			layer.msg("请输入密码",{time:1500});
			return false;
		}
		var data={"name":name,"pass":pass};
		$.ajax({
			type:"post",
			url:"<{:U('Login/login')}>",
			data:data,
			async:false,
			success:function(res){
				if(res.status==1){
					window.location.href="<{:U('Index/search')}>";
					return false;
				}
				layer.msg(res.info,{time:1500});
			}
		})
	};
</script>
</body>
</html>